package com.itheima.hashmap;

import java.util.HashMap;
import java.util.Set;

public class Demo02 {
    public static void main(String[] args) {
        HashMap<String, String> map = new HashMap<>();
        map.put("鹿晗","关晓彤");
        map.put("马蓉","王宝强");
        map.put("张若昀","唐艺昕");
        map.put("张恒","郑爽");
        //先获取所有的键 keySet()
        Set<String> keys = map.keySet();
        //遍历所有的键
        for (String key : keys) {
            //根据键找值  map.get(key)
            String value = map.get(key);
            System.out.println(key+"==="+value);

        }


    }
}
